import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import type { LoginInfo } from '@/api/model/model'

export const useLoginEmpStore = defineStore('loginEmp', () => {
  
  const loginEmp = ref<LoginInfo>({}) // 存储数据的地方

  
  const setLoginEmp = (emp:LoginInfo)=>{ // 存入数据
    loginEmp.value=emp;
  }

  const getLoginEmp = ()=>{  // 获取数据
    return loginEmp.value;
  }

  const clearLoginEmp=()=>{
    loginEmp.value={}
  }
  return { loginEmp, setLoginEmp, getLoginEmp, clearLoginEmp}
},{persist:true})
